package com.x.Servlet_01_操作流程;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

/**
 * ClassName: ServletDemo1
 * Package: IntelliJ IDEA
 * Description:

    @WebServlet("/s1")
    注解方式可以代替web.xml方式编辑url上下文路径
    loadOnStartup设置该servlet实例化顺序

 * Written by HanXu
 * Create 2024.08.01 4:39
 */

@WebServlet(value = {"/s1","/servlet1"},loadOnStartup = 10)
public class ServletDemo1 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("ServletDemo1执行了");

    }
}
